package lq.cloud.febsservertest.service;

import lq.cloud.febsservertest.service.fallback.HelloServiceFallback;
import lq.common.entity.StudyServerConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @program: cloud-study
 * @description: 调用study-server-system服务hello接口的feign连接
 * FeignClient:
 *  value为服务名称
 *  contexid为别名,在调用多个相同服务的时候,需要手动设置别名,否则会报错
 *  fallbackFactory 指定了回退方法，当我们调用远程服务出现异常时，就会调用这个回退方法
 * @author: LQ
 * @create: 2020-10-13 11:00
 */
@FeignClient(value = StudyServerConstant.STUDY_SERVER_SYSTEM,contextId = "helloServiceClient",fallbackFactory = HelloServiceFallback.class)
public interface IHelloService {

    @GetMapping("hello")
    String hello(@RequestParam("name") String name);
}
